<g-data-source url="/grule-manager/unitcases"  data-source-name="unitCaseList" />
<g-data-source url="/grule-manager/unitcases/mocks" data-source-name="UnitCaseMockSource"></g-data-source>
<g-data-source url="/grule-manager/unitcases/assets" data-source-name="AssetSource"></g-data-source>
<g-data-source url="/grule-manager/unitcases/results" data-source-name="ResultsSource" ></g-data-source>
<div class="engine-test">
	<!--测试管理左-->
	<div class="engine-test-l">
		<div class="engine-test-manage">
			<div class="engine-test-manage-l">测试管理</div>
			<div class="engine-test-manage-r model-r"><input type="text"  style="width: 90px" ng-model="searchKey" ><i class="icon-engine-search"></i><a href="javascript:void(0)" ng-click="addTest()" pg-per="{{packageId}}|1" pg-sta="{{status}}|0"><i class="icon-engine-plus"></i></a></div>
			<div class="clear"></div>
		</div>
		<table width="100%">
			<tr  ng-repeat="unitcase in unitcases|filter:{'unitCaseName': searchKey}">
				<td>
					<div class="engine-test-case" id="{{unitcase.id}}" name="caseList">
						<div class="engine-test-case-l"><a href="javascript:void(0)" ng-click="viewCase(unitcase.id,unitcase.unitCaseName)" ng-dblclick="editCase(unitcase.id)">{{unitcase.unitCaseName}}</a></div>
						<div class="engine-test-case-r"><a href="javascript:void(0)" ng-click="deleteCase(unitcase.id)" pg-per="{{packageId}}|1" pg-sta="{{status}}|1"><img src="../../static/images/close.png"></a></div>
						<div class="clear"></div>
					</div>
				</td>
			</tr>
		</table>
	</div>
	<!--测试管理左结束-->
	<!--测试管理右-->
	<div class="engine-test-r">
		<div class="engine-test-r-tit">{{unitCaseName}}</div>
		<div class="engine-test-r-con">
			<!--入参管理-->
			<div class="management">
				<div class="management-l" >入参管理
					<!--<input  type="file"  pg-per="{{packageId}}|1" id="objectFile"  pg-sta="{{status}}|0" style="width: 200px"/>
					<input type="button"  style="padding-left: 10px" ng-click="importParams2()" pg-per="{{packageId}}|1"  pg-sta="{{status}}|0" value="对象导入"/>-->
					<a href="javascript:;" class="file" onchange="showFileName('showObjFileName')" id="showObjFileName">对象导入
						<input type="file" name="objectFile" id="objectFile">
					</a>

					<button type="button"  class="engine-btn-default" ng-click="exportParams()" pg-per="{{packageId}}|1" pg-sta="{{status}}|0">导出</button>

				</div>
				<div class="management-r">
					<input  type="file"  pg-per="{{packageId}}|1" id="paramsFile"  pg-sta="{{status}}|0" style="width: 200px"/>
					<input type="button"  style="padding-left: 10px" ng-click="importParams()" pg-per="{{packageId}}|1"  pg-sta="{{status}}|0" value="导入"/>

					<button type="button" class="engine-btn-default" ng-click="addParam()" pg-per="{{packageId}}|1" pg-sta="{{status}}|0"><i class="icon-engine-plus" ></i>参数</button>

				</div>
				<div class="clear"></div>
			</div>
			<!--属性值-->
			<div class="engine-attribute engine-attribute-border">
				<table   width="100%">
					<tbody ng-repeat="unitCaseParam in unitCaseParams">
					<tr ng-if="unitCaseParam.dataType!='Object'">
						<td >
							<div class="model-value model-value-border" ng-dblclick="editParam(unitCaseParam)" pg-sta="{{status}}|0">
								<div class="model-value-l"><button type="button" class="engine-btn-model" >{{unitCaseParam.dataType}}</button></div>
								<div class="model-value-r" >{{unitCaseParam.paramName}}</div>
								<div class="model-value-r"  style="color:#999;margin-left: 20px">{{unitCaseParam.remark}}</div>
								<div class="model-value-right">
									<span class="results">{{unitCaseParam.param| maxLength:20}}</span>
									<span class="remove"><a href="javascript:void(0)" ng-click="deleteParam(unitCaseParam.id)" pg-per="{{packageId}}|1" pg-sta="{{status}}|0"><i class="icon-engine-removeove"></i></a></span>
								</div>
								<div class="clear"></div>
							</div>
						</td>
					</tr>
					<tr id="son{{unitCaseParam.id}}"  ng-if="unitCaseParam.dataType=='Object'">
						<td >
							<div class="model-value model-value-border" pg-sta="{{status}}|0">
								<div class="model-value-l"><button type="button" id="{{unitCaseParam.id}}" class="engine-btn-model" ng-click="viewObject(unitCaseParam.id,1)" ng-dblclick="editParam(unitCaseParam)">对象[+]</button></div>
								<div class="model-value-r" >{{unitCaseParam.paramName}}</div>
								<div class="model-value-r" style="color:#999;margin-left: 20px">{{unitCaseParam.remark}}</div>
								<div class="model-value-right">
									<span class="results"><a href="javascript:void(0)"  ng-click="addChild(unitCaseParam.id,'list')" pg-per="{{packageId}}|1" pg-sta="{{status}}|0"><i class="icon-engine-plus">L</i></a><a href="javascript:void(0)"  ng-click="addChild(unitCaseParam.id,'map')" pg-per="{{packageId}}|1" pg-sta="{{status}}|0"><i class="icon-engine-plus">M</i></a>&nbsp;{{unitCaseParam.param| maxLength:20}}</span>
									<span class="remove"><a href="javascript:void(0)" ng-click="deleteParam(unitCaseParam.id)" pg-per="{{packageId}}|1" pg-sta="{{status}}|0"><i class="icon-engine-removeove"></i></a></span>
								</div>
								<div class="clear"></div>
							</div>
						</td>
					</tr>
					</tbody>
				</table>
			</div>
			<!--属性值结束-->
			<!--入参管理结束-->
			<!--mock管理-->
			<div class="management">
				<div class="management-l">mock管理</div>
				<div class="management-r"><button type="button" class="engine-btn-default" ng-click="addMock()" pg-per="{{packageId}}|1" pg-sta="{{status}}|0"><i class="icon-engine-plus"></i>增加</button></div>
				<div class="clear"></div>
			</div>
			<!--表格-->
			<div class="col-md-10" style="width: 100%">
				<g-data-grid style="height: auto;" data-source-name="UnitCaseMockSource" data-on-load-success="onGridLoadSuccess(grid)"
							 ng-cloak>
					<g-column  data="mockComponent" width="150px">
						组件
					</g-column>
					<g-column  data="mockExpression" width="250px">
						mock表达式
					</g-column>
					<g-column  data="mockValue" width="250px">
						mock返回值
					</g-column>
					<g-column  align-center  width="150px">
						操作
						<g-column-tmpl >
							<a href="javascript:" ng-click="removeMock(row)" pg-sta="{{status}}|0"><span class="glyphicon glyphicon-remove"
																										 aria-hidden="true"></span>&nbsp;&nbsp;</a>
							<a href="javascript:" ng-click="updateMock(row)" pg-sta="{{status}}|0"><span
									class="glyphicon glyphicon-edit" aria-hidden="true"></span>&nbsp;&nbsp;修改</a>
						</g-column-tmpl>
					</g-column>
				</g-data-grid>
			</div>
			<br>
			<!--表格结束-->
			<!--mock管理结束-->
			<!--断言管理-->
			<div class="management">
				<div class="management-l">期望管理</div>
				<div class="management-r" ><button type="button" class="engine-btn-default" ng-click="addAsset()" pg-per="{{packageId}}|1" pg-sta="{{status}}|0"><i class="icon-engine-plus"></i>增加断言期望</button><!--
					<button type="button" class="engine-btn-default" ng-click="addResults()"><i class="icon-engine-plus"></i>增加结果集期望</button>-->
				</div>

				<div class="clear"></div>
			</div>
			<!--表格-->
			<div class="engine-table-a" >
				<g-data-grid data-source-name="AssetSource" style="height: auto;">
					<g-column  width="550px" data="expression">
						断言表达式
					</g-column>
					<g-column width="250px">
						操作
						<g-column-tmpl>
							<a href="javascript:" ng-click="removeAsset(row)" pg-per="{{packageId}}|1" pg-sta="{{status}}|0"><span
									class="glyphicon glyphicon-remove"
									aria-hidden="true"></span>&nbsp;&nbsp;删除</a>
							<a href="javascript:" ng-click="updateAsset(row)" pg-per="{{packageId}}|1" pg-sta="{{status}}|0"><span
									class="glyphicon glyphicon-edit" aria-hidden="true"></span>&nbsp;&nbsp;修改</a>
						</g-column-tmpl>
					</g-column>
				</g-data-grid>
			</div>
		</div>
	</div>
	<!--测试管理右结束-->
	<div class="clear"></div>
</div>